$OpenBSD: patch-kdm_kfrontend_genkdmconf_c,v 1.3 2014/01/31 17:45:35 zhuk Exp $
1. Provide OpenBSD-specific hacks for session startup and reset.
2. Deconfict with kdebase-3.x.
--- kdm/kfrontend/genkdmconf.c.orig	Thu Jan  2 23:27:49 2014
+++ kdm/kfrontend/genkdmconf.c	Fri Jan 31 21:40:25 2014
@@ -685,6 +685,9 @@ static const char def_startup[] =
 "#\n"
 "#chown $USER /dev/console\n"
 "\n"
+"# Allow to use OpenBSD Direct Rendering Manager\n"
+"chown $USER /dev/drm0\n"
+"\n"
 "# XDM configurations typically have sessreg here. KDM has it built-in.\n"
 "\n"
 "# NOTE: The session is aborted if the last command returns non-zero.\n";
@@ -699,6 +702,15 @@ static const char def_reset[] =
 "#chown root /dev/console\n"
 "#chmod 622 /dev/console\n"
 "\n"
+"# Reset access to OpenBSD Direct Rendering Manager\n"
+"chown root /dev/drm0\n"
+"chmod 0600 /dev/drm0\n"
+"\n"
+"# This is an OpenBSD-specific hack until ConsoleKit gets fixed.\n"
+"# OpenBSD does not support multi-seat X sessions now anyway.\n"
+"#\n"
+"pkill -u 0 ${LOCALBASE}/sbin/console-kit-daemon\n"
+"\n"
 "# XDM configurations typically have sessreg here. KDM has it built-in.\n";
 
 static const char def_session1[] =
@@ -771,7 +783,7 @@ static const char def_session2[] =
 "    exec $HOME/.xsession\n"
 "    ;;\n"
 "  default)\n"
-"    exec " KDE_BINDIR "/startkde\n"
+"    exec " KDE_BINDIR "/startkde4\n"
 "    ;;\n"
 "  *)\n"
 "    eval exec \"$session\"\n"
